﻿class Program
{
    public static void Main()
    {
        var random = new Random();
        var numbers = Enumerable.Range(0, 100)
            .Select(_ => random.Next(0, 1001)).ToList();

        //排序并计算结果
        var sort = numbers.OrderByDescending(n => n).ToList();
        int sum = sort.Sum();
        double avg = sort.Average();

        //只显示前20个数据，不然太长了
        Console.WriteLine("排序结果: " + string.Join(", ", sort.Take(20)) + "...");
        Console.WriteLine($"总和: {sum}, 平均值: {avg:F2}");
    }
}
